package com.sde.exception;

import com.sde.utils.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandle {

    @ExceptionHandler
    public Result handleBusinessException(BusinessException e) {
        log.info("程序运行出错");
        return Result.error(e.getMessage());
    }
}
